﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="BienBanChotKL.aspx.cs" Inherits="BienBanChotKL" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Báo cáo chốt khối lượng
                        
                    </h3>
                </div>
                <div class="panel-body">
                    <div>
                        <asp:TextBox ID="txtTuNgay" AutoPostBack="true" runat="server" placeholder="Từ ngày" Visible="true" Width="100px"
                            CssClass="form-control" ontextchanged="dlLoaiBaoCao_SelectedIndexChanged"></asp:TextBox>&nbsp;
                        <asp:TextBox ID="txtDenNgay" runat="server" AutoPostBack="true" placeholder="Đến ngày" Visible="true"
                            Width="100px" CssClass="form-control"  ontextchanged="dlLoaiBaoCao_SelectedIndexChanged"></asp:TextBox>
                        <asp:DropDownList ID="dlLoaiBaoCao" AutoPostBack="true" runat="server" Width="250px"
                            CssClass="form-control" 
                            onselectedindexchanged="dlLoaiBaoCao_SelectedIndexChanged">
                            <asp:ListItem Text="Chốt khối lượng xe ben" Value="1"></asp:ListItem>
                            <asp:ListItem Text="Chốt khối lượng trạm trộn" Value="2"></asp:ListItem>
                            <asp:ListItem Text="Chốt khối lượng NVKD" Value="3"></asp:ListItem>
                            <asp:ListItem Text="Chốt khối lượng xe bơm" Value="4"></asp:ListItem>
                            <asp:ListItem Text="Chốt khối lượng xe trộn" Value="5"></asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlBienSo" ToolTip="Chọn biển số" runat="server"
                            DataValueField="IDs" Width="200px" CssClass="form-control" 
                            DataTextField="DoiTuongChi">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlNhanVien" ToolTip="Chọn NVKD" runat="server"
                            DataValueField="IDs" Width="200px" CssClass="form-control" 
                            DataTextField="HoTen">
                        </asp:DropDownList>

                        <asp:DropDownList ID="dlKhachHang" ToolTip="Chọn khách hàng" runat="server" AutoPostBack="true"
                            DataValueField="IDs" Width="230px" Visible="false" CssClass="form-control" 
                            DataTextField="TenKhachHang" 
                            onselectedindexchanged="dlKhachHang_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlMacTX" ToolTip="Chọn mác thực xuất" runat="server" AutoPostBack="true"
                            DataValueField="IDs" Width="180px" Visible="false" CssClass="form-control" 
                            DataTextField="TenMacBeTong" 
                            onselectedindexchanged="dlMacTX_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlLoaiDa" Visible="false" ToolTip="Chọn loại đá" runat="server" Width="140px" CssClass="form-control" DataTextField="LoaiDa" DataValueField="IDs">
                        </asp:DropDownList>

                        <asp:Button ID="btnXem" ValidationGroup="Them" CssClass="btn btn-warning" runat="server"
                            Text="Tìm kiếm" OnClick="btnXem_Click" />
                        <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;"
                            Text="Xuất báo cáo" CssClass="btn btn-primary" OnClick="btnPrint_Click" />
                            
                         &nbsp;<asp:CheckBox ID="ckAll" Visible="false" runat="server" Text="Xuất tất cả" />
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtTuNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDenNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtTuNgay" ValidChars="/-" />
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender10" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtDenNgay" ValidChars="/-" />
                        <asp:HiddenField ID="hdTuNgay" runat="server" />
                        <asp:HiddenField ID="hdDenNgay" runat="server" />
                        <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="txtTuNgay" ErrorMessage="Nhập ngày bắt đầu" Display="None"
                            Text="*"></asp:RequiredFieldValidator>
                        <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="txtDenNgay" ErrorMessage="Nhập ngày kết thúc" Display="None"
                            Text="*"></asp:RequiredFieldValidator>
                        <asp:ValidationSummary ID="ValidationSummary1" HeaderText="" ShowMessageBox="true"
                            ValidationGroup="Them" ShowSummary="false" EnableClientScript="true" runat="server" />
                    </div>
                    <div style="width: 100%; margin-top: 0px; overflow-x: auto;" class="wrapper">
                        <asp:GridView ID="GVXeben" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" Visible="false" ShowFooter="true" Width="99%" CssClass="form-control withall"
                            OnRowDataBound="GV_RowDataBound">
                            <Columns>
                                <asp:BoundField DataField="STT" HeaderText="STT" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayNhap" HeaderText="Ngày nhập" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="BienSo" HeaderText="Biển số" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="NhaCungCap" HeaderText="Nhà cung cấp" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="TramTron" HeaderText="Trạm trộn" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="LoaiVL" HeaderText="Loại vật liệu" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="KLMua" HeaderText="KL mua" ItemStyle-HorizontalAlign="Right" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <asp:GridView ID="GVTramTron" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="true" Visible="false" Width="99%" CssClass="form-control withall"
                            OnRowDataBound="GV_RowDataBound">
                            <Columns>
                                <asp:BoundField DataField="STT" HeaderText="STT" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayXuat" HeaderText="Ngày xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KhachHang" HeaderText="Khách hàng" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="MacKH" HeaderText="Mác hợp đồng" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="MacTX" HeaderText="Mác thực xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KLThucXuat" HeaderText="KL thực xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiDa" HeaderText="Loại đá" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiPhuGia" HeaderText="Loại phụ gia" ItemStyle-HorizontalAlign="Left" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <asp:GridView ID="GVNVKD" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="true" Visible="false" Width="99%" CssClass="form-control withall"
                            OnRowDataBound="GV_RowDataBound">
                            <Columns>
                                <asp:BoundField DataField="STT" HeaderText="STT" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayXuat" HeaderText="Ngày xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KhachHang" HeaderText="Khách hàng" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="MacKH" HeaderText="Mác hợp đồng" ItemStyle-HorizontalAlign="Center" />
                                <%--<asp:BoundField DataField="MacTX" HeaderText="Mác thực xuất" ItemStyle-HorizontalAlign="Center" />--%>
                                <asp:BoundField DataField="KLKhachHang" HeaderText="KL bán" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KLThucXuat" HeaderText="KL thực xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KLNVKD" HeaderText="KL NVKD" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiDa" HeaderText="Loại đá" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiCaBom" HeaderText="Loại ca bơm" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="ThanhTienHang" HeaderText="Thành tiền hàng" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N0}" />
                                <asp:BoundField DataField="NVKD" HeaderText="Nhân viên KD" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="HinhThuc" HeaderText="Hình thức HĐ" ItemStyle-HorizontalAlign="Left" />
                                
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <asp:GridView ID="GVXeBom" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="true" Visible="false" Width="99%" CssClass="form-control withall"
                            OnRowDataBound="GV_RowDataBound">
                            <Columns>
                                <asp:BoundField DataField="STT" HeaderText="STT" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayXuat" HeaderText="Ngày xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KhachHang" HeaderText="Khách hàng" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="MacKH" HeaderText="Mác hợp đồng" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiDa" HeaderText="Loại đá" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KLThucXuat" HeaderText="KL thực xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="LoaiCaBom" HeaderText="Loại ca bơm" ItemStyle-CssClass="paddingleft" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <asp:GridView ID="gvXeBeTong" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" Visible="false" ShowFooter="true" Width="99%" CssClass="form-control withall"
                            OnRowDataBound="GV_RowDataBound">
                            <Columns>
                                <asp:BoundField DataField="STT" HeaderText="STT" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="NgayXuat" HeaderText="Ngày xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="BienSo" HeaderText="Biển số" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="LaiXe" HeaderText="Lái xe" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="CaLamViec" HeaderText="Ca làm việc" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="KMVC" HeaderText="KM vận chuyển" ItemStyle-HorizontalAlign="Center"  />
                                <asp:BoundField DataField="KhachHang" HeaderText="Khách hàng" ItemStyle-CssClass="paddingleft" />
                                <asp:BoundField DataField="MacKH" HeaderText="Mác HĐ" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="KLThucXuat" HeaderText="KL thực xuất" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="HeSo" HeaderText="Hệ số PC" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="SoTien" HeaderText="Số tiền" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="PhiRuaXe" HeaderText="Phí rửa xe" ItemStyle-HorizontalAlign="Right" />
                                <asp:BoundField DataField="ThanhTien" HeaderText="Thành tiền" ItemStyle-HorizontalAlign="Right" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                    </div>
                    <div style="margin: 5px;">
                        <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                        <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                            OnClick="btnPre_Click" />
                        <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                            OnClick="btnNext_Click" />
                    </div>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnSave" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
